//
//  ViewController.m
//  06_Homework
//
//  Created by 徐昊 on 16/7/21.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    UILabel *message = [[UILabel alloc] init];
    message.text = @"消息";
    message.frame = CGRectMake(0, 0, 50, 50);
    UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:@[message, @"电话"]];
    message.font = [UIFont systemFontOfSize:17 weight:10];
    segment.frame = CGRectMake(100, 100, 150, 30);
    segment.tintColor = [UIColor whiteColor];
    self.navigationItem.titleView = segment;
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.090 green:0.659 blue:0.953 alpha:1.000];
    UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"u=1824248709,3692643173&fm=21&gp=0"]];
    img.frame = CGRectMake(0, 0, 30, 30);
    img.layer.cornerRadius = 15;
    img.layer.masksToBounds = YES;
    UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithCustomView:img];
    self.navigationItem.leftBarButtonItem = button;
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
